package com.leyou.controller;

import com.leyou.Service.CategoryService;
import com.leyou.item.dto.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author zhaoxiaozhao
 * @description 类目的action
 * @date 2018/11/10 16:23
 */
@Controller
@RequestMapping("category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @RequestMapping("list")
    public ResponseEntity<List<Category>>  queryCagteory(){
        List<Category> categoryList = categoryService.listCagegory();
        return ResponseEntity.ok(categoryList);
    }

}